package com.deep.spring.v5;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@CrossOrigin(origins = {"http://localhost:9000", "null"}, allowedHeaders = "xx")
@Configuration
public class TestConfigurer implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {

//        registry.addResourceHandler("/demo/**").addResourceLocations("classpath:/demo/").setCacheControl(CacheControl.maxAge(-1, TimeUnit.MICROSECONDS));
//        registry.addResourceHandler("/a.txt").addResourceLocations("classpath:/a/a.txt");

    }
}
